/* Loan
*************************************************************************************
*
*   A struct used for creating monthly compound loans given an interest rate to be
*	spread across all 12 months.
*
*	Can calculate monthly payments, monthly interest, total amount to be paid, and
*	total interest.
*
*************************************************************************************
*
*   Credits
*
*		Richard Rios
*		Aaron Solomon
*
*************************************************************************************
*/
	#ifndef LOAN
	#define LOAN

	#include "EXIT_CODE.h"
	#include <math.h>
	#include <iostream>

	using namespace std;
/*
************************************************************************************/

struct Loan {
public:
	/*************************************************************************************
	*
	*	Constructors
	*/
		Loan(double loanAmount, int numberOfPayments, double annualInterestRate);
		Loan();
	/*
	*
	*   Description
	*   -----------------------
	*
	*       Creates and initialize the Loan
	*
	*   Takes
	*   -----------------------
	*
	*       double principal
	*       double annualInterest
	*		int term
	*
	*   Returns
	*   -----------------------
	*
	*       initialized Loan
	*
	*		initialized to 0 in the case of no arguments
	*
	*************************************************************************************/

private:
	/*************************************************************************************
	*
	*	Fields
	*/
		double	loanAmount;
		int		numberOfPayments;
		double	annualInterestRate;
	/*
	*************************************************************************************/

public:
	/*************************************************************************************
	*
	*	Operators
	*
	*		Setters
	*/
			/*Input values must be >= 0*/
			void setLoanAmount			(double loanAmount);
			void setNumberOfPayments	(int numberOfPayments);
			void setAnnualInterestRate	(double annualInterestRate);
	/*
	**************************************************************************************
	*
	*		Getters
	*/
			double	getLoanAmount();
			int		getNumberOfPayments();
			double	getAnnualInterestRate ();
	/*
	*************************************************************************************/
	
	/*************************************************************************************
	*
	*	Methods
	*/
		double calculateMonthlyInterestRate();
		double calculateMonthlyPayment();
		double calculateTotalAmountPaid();
		double calculateTotalInterest();
	/*
	*************************************************************************************/
}; //struct Loan

#else
#endif